package dmp.utils

/**
  * author:CN.CDG
  * Date:2019/2/14
  * Time:13:32
  **/
object RptUtil {
  def caculateReq(reqMode:Int,proNode:Int)={

    if(reqMode==1&&proNode==1) List[Double](1,0,0) else  List[Double](0,0,0)
    if(reqMode==1&&proNode==2) List[Double](1,1,0) else  List[Double](0,0,0)
    if(reqMode==1&&proNode==3) List[Double](1,1,1) else  List[Double](0,0,0)
  }
  def caculateRtb(effTive:Int,bill:Int,bid:Int,orderId:Int,win:Int,winPrice:Double,adPayMent:Double)={
    //参与竞价,竞价成功  List（参与竞价，竞价成功）
    //先提取需要的字段

    if(effTive==1 && bill==1 && orderId!=0) List[Double](1,0,0,0) else  List[Double](0,0,0,0)
    if(effTive==1 && bill==1 && win==1) List[Double](0,1,winPrice/1000.0 ,adPayMent/1000.0) else List[Double](0,0,0,0)

  }
  def caculateShow(reqMode:Int,effTive:Int)={
    //判断展示，点击
    if(reqMode==2 && effTive==1) List[Double](1,0) else List[Double](0,0)
    if(reqMode==3 && effTive==1) List[Double](0,1) else List[Double](0,0)
  }
}
